package com.johnny.myRedis;

import redis.clients.jedis.Jedis;

/**
 * 主从复制代码
 */
public class MyRedisMS {
     public static void main(String[] args){
         Jedis jedis_M = new Jedis("192.168.99.100", 6379);   //主机
         Jedis jedis_S = new Jedis("192.168.99.100", 6380);     //从机
         jedis_S.slaveof("192.168.99.100", 6379);
         jedis_M.set("class","1122");
         String result=jedis_S.get("class");
         System.out.println(result);
      }
}
